// Copyright 2018-2021 Polyaxon, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * Polyaxon SDKs and REST API specification.
 * Polyaxon SDKs and REST API specification.
 *
 * The version of the OpenAPI document: 1.7.4
 * Contact: contact@polyaxon.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */


import ApiClient from "../ApiClient";
import RuntimeError from '../model/RuntimeError';
import V1ComponentHub from '../model/V1ComponentHub';
import V1ComponentHubSettings from '../model/V1ComponentHubSettings';
import V1ComponentVersion from '../model/V1ComponentVersion';
import V1EntityStageBodyRequest from '../model/V1EntityStageBodyRequest';
import V1ListActivitiesResponse from '../model/V1ListActivitiesResponse';
import V1ListComponentHubsResponse from '../model/V1ListComponentHubsResponse';
import V1ListComponentVersionsResponse from '../model/V1ListComponentVersionsResponse';
import V1Stage from '../model/V1Stage';

/**
* ComponentHubV1 service.
* @module api/ComponentHubV1Api
* @version 1.7.4
*/
export default class ComponentHubV1Api {

    /**
    * Constructs a new ComponentHubV1Api. 
    * Polyaxon sdk
    * @alias module:api/ComponentHubV1Api
    * @class
    * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
    * default to {@link module:ApiClient#instance} if unspecified.
    */
    constructor(apiClient) {
        this.apiClient = apiClient || ApiClient.instance;
    }


    /**
     * Callback function to receive the result of the archiveComponentHub operation.
     * @callback module:api/ComponentHubV1Api~archiveComponentHubCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Archive hub component
     * @param {String} owner Owner of the namespace
     * @param {String} name Component under namesapce
     * @param {module:api/ComponentHubV1Api~archiveComponentHubCallback} callback The callback function, accepting three arguments: error, data, response
     */
    archiveComponentHub(owner, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling archiveComponentHub");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling archiveComponentHub");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{name}/archive', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the bookmarkComponentHub operation.
     * @callback module:api/ComponentHubV1Api~bookmarkComponentHubCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Bookmark component hub
     * @param {String} owner Owner of the namespace
     * @param {String} name Component under namesapce
     * @param {module:api/ComponentHubV1Api~bookmarkComponentHubCallback} callback The callback function, accepting three arguments: error, data, response
     */
    bookmarkComponentHub(owner, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling bookmarkComponentHub");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling bookmarkComponentHub");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{name}/bookmark', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the createComponentHub operation.
     * @callback module:api/ComponentHubV1Api~createComponentHubCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ComponentHub} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Create hub component
     * @param {String} owner Owner of the namespace
     * @param {module:model/V1ComponentHub} body Component body
     * @param {module:api/ComponentHubV1Api~createComponentHubCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ComponentHub}
     */
    createComponentHub(owner, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling createComponentHub");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling createComponentHub");
      }

      let pathParams = {
        'owner': owner
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ComponentHub;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/create', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the createComponentVersion operation.
     * @callback module:api/ComponentHubV1Api~createComponentVersionCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ComponentVersion} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Create component version
     * @param {String} owner Owner of the namespace
     * @param {String} component Component name
     * @param {module:model/V1ComponentVersion} body Component version body
     * @param {module:api/ComponentHubV1Api~createComponentVersionCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ComponentVersion}
     */
    createComponentVersion(owner, component, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling createComponentVersion");
      }
      // verify the required parameter 'component' is set
      if (component === undefined || component === null) {
        throw new Error("Missing the required parameter 'component' when calling createComponentVersion");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling createComponentVersion");
      }

      let pathParams = {
        'owner': owner,
        'component': component
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ComponentVersion;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{component}/versions', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the createComponentVersionStage operation.
     * @callback module:api/ComponentHubV1Api~createComponentVersionStageCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1Stage} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Create new component version stage
     * @param {String} owner Owner of the namespace
     * @param {String} entity Entity namespace
     * @param {String} name Name of the version to apply the stage to
     * @param {module:model/V1EntityStageBodyRequest} body 
     * @param {module:api/ComponentHubV1Api~createComponentVersionStageCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1Stage}
     */
    createComponentVersionStage(owner, entity, name, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling createComponentVersionStage");
      }
      // verify the required parameter 'entity' is set
      if (entity === undefined || entity === null) {
        throw new Error("Missing the required parameter 'entity' when calling createComponentVersionStage");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling createComponentVersionStage");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling createComponentVersionStage");
      }

      let pathParams = {
        'owner': owner,
        'entity': entity,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1Stage;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{entity}/versions/{name}/stages', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the deleteComponentHub operation.
     * @callback module:api/ComponentHubV1Api~deleteComponentHubCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Delete hub component
     * @param {String} owner Owner of the namespace
     * @param {String} name Component under namesapce
     * @param {module:api/ComponentHubV1Api~deleteComponentHubCallback} callback The callback function, accepting three arguments: error, data, response
     */
    deleteComponentHub(owner, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling deleteComponentHub");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling deleteComponentHub");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{name}', 'DELETE',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the deleteComponentVersion operation.
     * @callback module:api/ComponentHubV1Api~deleteComponentVersionCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Delete component version
     * @param {String} owner Owner of the namespace
     * @param {String} entity Entity: project name, hub name, registry name, ...
     * @param {String} name Sub-entity name
     * @param {module:api/ComponentHubV1Api~deleteComponentVersionCallback} callback The callback function, accepting three arguments: error, data, response
     */
    deleteComponentVersion(owner, entity, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling deleteComponentVersion");
      }
      // verify the required parameter 'entity' is set
      if (entity === undefined || entity === null) {
        throw new Error("Missing the required parameter 'entity' when calling deleteComponentVersion");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling deleteComponentVersion");
      }

      let pathParams = {
        'owner': owner,
        'entity': entity,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{entity}/versions/{name}', 'DELETE',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the getComponentHub operation.
     * @callback module:api/ComponentHubV1Api~getComponentHubCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ComponentHub} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Get hub component
     * @param {String} owner Owner of the namespace
     * @param {String} name Component under namesapce
     * @param {module:api/ComponentHubV1Api~getComponentHubCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ComponentHub}
     */
    getComponentHub(owner, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling getComponentHub");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling getComponentHub");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ComponentHub;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{name}', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the getComponentHubActivities operation.
     * @callback module:api/ComponentHubV1Api~getComponentHubActivitiesCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ListActivitiesResponse} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Get hub activities
     * @param {String} owner Owner of the namespace
     * @param {String} name Entity managing the resource
     * @param {Object} opts Optional parameters
     * @param {Number} opts.offset Pagination offset.
     * @param {Number} opts.limit Limit size.
     * @param {String} opts.sort Sort to order the search.
     * @param {String} opts.query Query filter the search.
     * @param {String} opts.mode Mode the search.
     * @param {module:api/ComponentHubV1Api~getComponentHubActivitiesCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ListActivitiesResponse}
     */
    getComponentHubActivities(owner, name, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling getComponentHubActivities");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling getComponentHubActivities");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
        'offset': opts['offset'],
        'limit': opts['limit'],
        'sort': opts['sort'],
        'query': opts['query'],
        'mode': opts['mode']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ListActivitiesResponse;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{name}/activities', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the getComponentHubSettings operation.
     * @callback module:api/ComponentHubV1Api~getComponentHubSettingsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ComponentHubSettings} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Get hub component settings
     * @param {String} owner Owner of the namespace
     * @param {String} name Component under namesapce
     * @param {module:api/ComponentHubV1Api~getComponentHubSettingsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ComponentHubSettings}
     */
    getComponentHubSettings(owner, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling getComponentHubSettings");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling getComponentHubSettings");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ComponentHubSettings;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{name}/settings', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the getComponentVersion operation.
     * @callback module:api/ComponentHubV1Api~getComponentVersionCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ComponentVersion} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Get component version
     * @param {String} owner Owner of the namespace
     * @param {String} entity Entity: project name, hub name, registry name, ...
     * @param {String} name Sub-entity name
     * @param {module:api/ComponentHubV1Api~getComponentVersionCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ComponentVersion}
     */
    getComponentVersion(owner, entity, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling getComponentVersion");
      }
      // verify the required parameter 'entity' is set
      if (entity === undefined || entity === null) {
        throw new Error("Missing the required parameter 'entity' when calling getComponentVersion");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling getComponentVersion");
      }

      let pathParams = {
        'owner': owner,
        'entity': entity,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ComponentVersion;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{entity}/versions/{name}', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the getComponentVersionStages operation.
     * @callback module:api/ComponentHubV1Api~getComponentVersionStagesCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1Stage} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Get component version stages
     * @param {String} owner Owner of the namespace
     * @param {String} entity Entity: project name, hub name, registry name, ...
     * @param {String} name Sub-entity name
     * @param {module:api/ComponentHubV1Api~getComponentVersionStagesCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1Stage}
     */
    getComponentVersionStages(owner, entity, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling getComponentVersionStages");
      }
      // verify the required parameter 'entity' is set
      if (entity === undefined || entity === null) {
        throw new Error("Missing the required parameter 'entity' when calling getComponentVersionStages");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling getComponentVersionStages");
      }

      let pathParams = {
        'owner': owner,
        'entity': entity,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1Stage;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{entity}/versions/{name}/stages', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the listComponentHubNames operation.
     * @callback module:api/ComponentHubV1Api~listComponentHubNamesCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ListComponentHubsResponse} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List hub component names
     * @param {String} owner Owner of the namespace
     * @param {Object} opts Optional parameters
     * @param {Number} opts.offset Pagination offset.
     * @param {Number} opts.limit Limit size.
     * @param {String} opts.sort Sort to order the search.
     * @param {String} opts.query Query filter the search.
     * @param {module:api/ComponentHubV1Api~listComponentHubNamesCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ListComponentHubsResponse}
     */
    listComponentHubNames(owner, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling listComponentHubNames");
      }

      let pathParams = {
        'owner': owner
      };
      let queryParams = {
        'offset': opts['offset'],
        'limit': opts['limit'],
        'sort': opts['sort'],
        'query': opts['query']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ListComponentHubsResponse;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/names', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the listComponentHubs operation.
     * @callback module:api/ComponentHubV1Api~listComponentHubsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ListComponentHubsResponse} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List hub components
     * @param {String} owner Owner of the namespace
     * @param {Object} opts Optional parameters
     * @param {Number} opts.offset Pagination offset.
     * @param {Number} opts.limit Limit size.
     * @param {String} opts.sort Sort to order the search.
     * @param {String} opts.query Query filter the search.
     * @param {module:api/ComponentHubV1Api~listComponentHubsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ListComponentHubsResponse}
     */
    listComponentHubs(owner, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling listComponentHubs");
      }

      let pathParams = {
        'owner': owner
      };
      let queryParams = {
        'offset': opts['offset'],
        'limit': opts['limit'],
        'sort': opts['sort'],
        'query': opts['query']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ListComponentHubsResponse;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/list', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the listComponentVersionNames operation.
     * @callback module:api/ComponentHubV1Api~listComponentVersionNamesCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ListComponentVersionsResponse} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List component version names
     * @param {String} owner Owner of the namespace
     * @param {String} name Entity managing the resource
     * @param {Object} opts Optional parameters
     * @param {Number} opts.offset Pagination offset.
     * @param {Number} opts.limit Limit size.
     * @param {String} opts.sort Sort to order the search.
     * @param {String} opts.query Query filter the search.
     * @param {String} opts.mode Mode the search.
     * @param {module:api/ComponentHubV1Api~listComponentVersionNamesCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ListComponentVersionsResponse}
     */
    listComponentVersionNames(owner, name, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling listComponentVersionNames");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling listComponentVersionNames");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
        'offset': opts['offset'],
        'limit': opts['limit'],
        'sort': opts['sort'],
        'query': opts['query'],
        'mode': opts['mode']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ListComponentVersionsResponse;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{name}/versions/names', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the listComponentVersions operation.
     * @callback module:api/ComponentHubV1Api~listComponentVersionsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ListComponentVersionsResponse} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * List component versions
     * @param {String} owner Owner of the namespace
     * @param {String} name Entity managing the resource
     * @param {Object} opts Optional parameters
     * @param {Number} opts.offset Pagination offset.
     * @param {Number} opts.limit Limit size.
     * @param {String} opts.sort Sort to order the search.
     * @param {String} opts.query Query filter the search.
     * @param {String} opts.mode Mode the search.
     * @param {module:api/ComponentHubV1Api~listComponentVersionsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ListComponentVersionsResponse}
     */
    listComponentVersions(owner, name, opts, callback) {
      opts = opts || {};
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling listComponentVersions");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling listComponentVersions");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
        'offset': opts['offset'],
        'limit': opts['limit'],
        'sort': opts['sort'],
        'query': opts['query'],
        'mode': opts['mode']
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = V1ListComponentVersionsResponse;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{name}/versions', 'GET',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the patchComponentHub operation.
     * @callback module:api/ComponentHubV1Api~patchComponentHubCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ComponentHub} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Patch hub component
     * @param {String} owner Owner of the namespace
     * @param {String} component_name Optional component name, should be a valid fully qualified value: name[:version]
     * @param {module:model/V1ComponentHub} body Component body
     * @param {module:api/ComponentHubV1Api~patchComponentHubCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ComponentHub}
     */
    patchComponentHub(owner, component_name, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling patchComponentHub");
      }
      // verify the required parameter 'component_name' is set
      if (component_name === undefined || component_name === null) {
        throw new Error("Missing the required parameter 'component_name' when calling patchComponentHub");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling patchComponentHub");
      }

      let pathParams = {
        'owner': owner,
        'component.name': component_name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ComponentHub;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{component.name}', 'PATCH',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the patchComponentHubSettings operation.
     * @callback module:api/ComponentHubV1Api~patchComponentHubSettingsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ComponentHubSettings} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Patch hub component settings
     * @param {String} owner Owner of the namespace
     * @param {String} component Hub name
     * @param {module:model/V1ComponentHubSettings} body Hub settings body
     * @param {module:api/ComponentHubV1Api~patchComponentHubSettingsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ComponentHubSettings}
     */
    patchComponentHubSettings(owner, component, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling patchComponentHubSettings");
      }
      // verify the required parameter 'component' is set
      if (component === undefined || component === null) {
        throw new Error("Missing the required parameter 'component' when calling patchComponentHubSettings");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling patchComponentHubSettings");
      }

      let pathParams = {
        'owner': owner,
        'component': component
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ComponentHubSettings;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{component}/settings', 'PATCH',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the patchComponentVersion operation.
     * @callback module:api/ComponentHubV1Api~patchComponentVersionCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ComponentVersion} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Patch component version
     * @param {String} owner Owner of the namespace
     * @param {String} component Component name
     * @param {String} version_name Optional component name, should be a valid fully qualified value: name[:version]
     * @param {module:model/V1ComponentVersion} body Component version body
     * @param {module:api/ComponentHubV1Api~patchComponentVersionCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ComponentVersion}
     */
    patchComponentVersion(owner, component, version_name, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling patchComponentVersion");
      }
      // verify the required parameter 'component' is set
      if (component === undefined || component === null) {
        throw new Error("Missing the required parameter 'component' when calling patchComponentVersion");
      }
      // verify the required parameter 'version_name' is set
      if (version_name === undefined || version_name === null) {
        throw new Error("Missing the required parameter 'version_name' when calling patchComponentVersion");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling patchComponentVersion");
      }

      let pathParams = {
        'owner': owner,
        'component': component,
        'version.name': version_name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ComponentVersion;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{component}/versions/{version.name}', 'PATCH',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the restoreComponentHub operation.
     * @callback module:api/ComponentHubV1Api~restoreComponentHubCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Restore hub component
     * @param {String} owner Owner of the namespace
     * @param {String} name Component under namesapce
     * @param {module:api/ComponentHubV1Api~restoreComponentHubCallback} callback The callback function, accepting three arguments: error, data, response
     */
    restoreComponentHub(owner, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling restoreComponentHub");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling restoreComponentHub");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{name}/restore', 'POST',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the unbookmarkComponentHub operation.
     * @callback module:api/ComponentHubV1Api~unbookmarkComponentHubCallback
     * @param {String} error Error message, if any.
     * @param data This operation does not return a value.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Unbookmark component hub
     * @param {String} owner Owner of the namespace
     * @param {String} name Component under namesapce
     * @param {module:api/ComponentHubV1Api~unbookmarkComponentHubCallback} callback The callback function, accepting three arguments: error, data, response
     */
    unbookmarkComponentHub(owner, name, callback) {
      let postBody = null;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling unbookmarkComponentHub");
      }
      // verify the required parameter 'name' is set
      if (name === undefined || name === null) {
        throw new Error("Missing the required parameter 'name' when calling unbookmarkComponentHub");
      }

      let pathParams = {
        'owner': owner,
        'name': name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = [];
      let accepts = ['application/json'];
      let returnType = null;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{name}/unbookmark', 'DELETE',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the updateComponentHub operation.
     * @callback module:api/ComponentHubV1Api~updateComponentHubCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ComponentHub} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Update hub component
     * @param {String} owner Owner of the namespace
     * @param {String} component_name Optional component name, should be a valid fully qualified value: name[:version]
     * @param {module:model/V1ComponentHub} body Component body
     * @param {module:api/ComponentHubV1Api~updateComponentHubCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ComponentHub}
     */
    updateComponentHub(owner, component_name, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling updateComponentHub");
      }
      // verify the required parameter 'component_name' is set
      if (component_name === undefined || component_name === null) {
        throw new Error("Missing the required parameter 'component_name' when calling updateComponentHub");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling updateComponentHub");
      }

      let pathParams = {
        'owner': owner,
        'component.name': component_name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ComponentHub;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{component.name}', 'PUT',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the updateComponentHubSettings operation.
     * @callback module:api/ComponentHubV1Api~updateComponentHubSettingsCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ComponentHubSettings} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Update hub component settings
     * @param {String} owner Owner of the namespace
     * @param {String} component Hub name
     * @param {module:model/V1ComponentHubSettings} body Hub settings body
     * @param {module:api/ComponentHubV1Api~updateComponentHubSettingsCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ComponentHubSettings}
     */
    updateComponentHubSettings(owner, component, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling updateComponentHubSettings");
      }
      // verify the required parameter 'component' is set
      if (component === undefined || component === null) {
        throw new Error("Missing the required parameter 'component' when calling updateComponentHubSettings");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling updateComponentHubSettings");
      }

      let pathParams = {
        'owner': owner,
        'component': component
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ComponentHubSettings;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{component}/settings', 'PUT',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }

    /**
     * Callback function to receive the result of the updateComponentVersion operation.
     * @callback module:api/ComponentHubV1Api~updateComponentVersionCallback
     * @param {String} error Error message, if any.
     * @param {module:model/V1ComponentVersion} data The data returned by the service call.
     * @param {String} response The complete HTTP response.
     */

    /**
     * Update component version
     * @param {String} owner Owner of the namespace
     * @param {String} component Component name
     * @param {String} version_name Optional component name, should be a valid fully qualified value: name[:version]
     * @param {module:model/V1ComponentVersion} body Component version body
     * @param {module:api/ComponentHubV1Api~updateComponentVersionCallback} callback The callback function, accepting three arguments: error, data, response
     * data is of type: {@link module:model/V1ComponentVersion}
     */
    updateComponentVersion(owner, component, version_name, body, callback) {
      let postBody = body;
      // verify the required parameter 'owner' is set
      if (owner === undefined || owner === null) {
        throw new Error("Missing the required parameter 'owner' when calling updateComponentVersion");
      }
      // verify the required parameter 'component' is set
      if (component === undefined || component === null) {
        throw new Error("Missing the required parameter 'component' when calling updateComponentVersion");
      }
      // verify the required parameter 'version_name' is set
      if (version_name === undefined || version_name === null) {
        throw new Error("Missing the required parameter 'version_name' when calling updateComponentVersion");
      }
      // verify the required parameter 'body' is set
      if (body === undefined || body === null) {
        throw new Error("Missing the required parameter 'body' when calling updateComponentVersion");
      }

      let pathParams = {
        'owner': owner,
        'component': component,
        'version.name': version_name
      };
      let queryParams = {
      };
      let headerParams = {
      };
      let formParams = {
      };

      let authNames = ['ApiKey'];
      let contentTypes = ['application/json'];
      let accepts = ['application/json'];
      let returnType = V1ComponentVersion;
      return this.apiClient.callApi(
        '/api/v1/{owner}/hub/{component}/versions/{version.name}', 'PUT',
        pathParams, queryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, null, callback
      );
    }


}
